package com.sky.his.api.mis.controller.form;

import lombok.Data;

import javax.validation.constraints.*;

@Data
public class InsertUserForm {
    @NotBlank(message = "username不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9]{5,50}$", message = "username内容不正确")
    private String username;

    @NotBlank(message = "password不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9]{6,20}$", message = "password内容不正确")
    private String password;

    @NotBlank(message = "name内容不能为空")
    private String name;

    @NotBlank(message = "sex内容不能为空")
    @Pattern(regexp = "^男$|^女$", message = "sex内容不正确")
    private String sex;

    @NotBlank(message = "tel内容不能为空")
    @Pattern(regexp = "^1[1-9]\\d{9}$", message = "tel内容不正确")
    private String tel;

    @NotBlank(message = "email内容不能为空")
    @Email(message = "email内容不正确")
    private String email;

    @NotBlank(message = "入职日期格式不能为空")
    @Pattern(regexp = "^(\\d{4})-(\\d{2})-(\\d{2})$", message = "入职日期格式不正确，应该是 yyyy-MM-dd")
    private String hiredate;

    @NotEmpty(message = "role不能为空")
    private Integer[] role;

    @Min(value = 1, message = "deptId不能小于1")
    private Integer deptId;

}
